package com.letoken.platform.app.controller;

import com.letoken.platform.app.service.AppUserAssetsService;
import com.letoken.platform.pub.annotation.auth.NotAuthorization;
import com.letoken.platform.pub.annotation.pub.Trim;
import com.letoken.platform.pub.req.PageData;
import com.letoken.platform.pub.res.ApiResponse;
import com.letoken.platform.repo.app.res.assets.QueryAnnDetailRes;
import com.letoken.platform.repo.app.res.assets.QueryAnnRes;
import com.letoken.platform.repo.utlis.WebUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * @author letokenlabs
 * @date 2022/12/3$
 */
@RestController
@RequestMapping("/announcement")
@Api(tags = "我的-系统公告", description = "系统公告接口")
public class AppAnnouncementController {
    @Autowired
    private AppUserAssetsService appUserAssetsService;

    @NotAuthorization
    @GetMapping("/list")
    @ApiOperation(value = "系统公告-列表", notes = "查询系统公告列表")
    public ApiResponse<List<QueryAnnRes>> queryAssetsList() {
        String language = WebUtils.getLanguage();
        return ApiResponse.create(appUserAssetsService.queryAssetsList(language));
    }

    @NotAuthorization
    @Trim
    @GetMapping("/detail/{id}")
    @ApiOperation(value = "系统公告-详情", notes = "系统公告-详情")
    public ApiResponse<QueryAnnDetailRes> queryAssetsDetail(@PathVariable("id") Integer id) {
        return ApiResponse.create(appUserAssetsService.queryAssetsDetail(id));
    }

//    @GetMapping("/detail")
//    @ApiOperation(value = "代币详情-价格历史", notes = "查询单个代币价格和曲线信息")
//    public ApiResponse<String> queryTokenAssetsPrices(
//        @ApiParam(name = "id", value = "公告ID", required = true) @RequestParam String id) {
//        return null;
//    }

}
